package com.cci.kangdao.controller;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.cci.kangdao.aop.annotation.NoDuplicateSubmission;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.cci.kangdao.service.ServiceManagerAffirmService;
import com.cci.kangdao.utilTool.ParameterTool;

@Controller
public class ServiceManagerAffirm {


	/**
	 *  服务经理确认接口
	 *  app传入字段
	 *  OrderId				工单id
		PositionLon			操作人经度
		PositionLat			操作人纬度
		OrderNo				工单编号
		OrderSource			工单来源
		Location			操作地址
		ServiceStationId	服务站id
		UserId				用户id
		IMEI				手机串号
	 * 
	 * 
	 * 
	 */
	private Logger log = Logger.getLogger(this.getClass().getName());
	
	@Autowired
	private ServiceManagerAffirmService serviceManagerAffirmService;

    @NoDuplicateSubmission
    @RequestMapping("/ServiceManagerAffirm.aspx")
    public ModelAndView ServiceManagerAffirm(HttpServletRequest request, HttpServletResponse response) throws Exception {
        try{
            Map<String, Object> map = ParameterTool.getParameterRequest(request, true);
            map.put("response", response);
            map.put("request", request);
            return serviceManagerAffirmService.affirm(map);
        }catch(Exception ex){
            log.error(ex.getMessage(),ex);

            String msg = "{\"status\": -99,\"msg\": \"未知错误\"}";
            ParameterTool.writeResponse(response, msg);
        }
        return null;
    }


}
